import 'dart:convert';

/// id : "1892c2a7877740a397859fb71852f842"
/// roomId : "17230061f97e4e798c84efedbc43be8a"
/// userId : "28ee9bfec6e14a0888899352d37d055e"
/// createTime : "2023-05-05T23:59:28"
/// updateTime : "2023-05-05T23:59:27"
/// isDeleted : false
/// userType : "房主"
/// roomName : "刺激性经济学教学"

GroupBean groupBeanFromJson(String str) => GroupBean.fromJson(json.decode(str));

String groupBeanToJson(GroupBean data) => json.encode(data.toJson());

class GroupBean {
  GroupBean({
    String? id,
    String? roomId,
    String? userId,
    String? createTime,
    String? updateTime,
    bool? isDeleted,
    String? userType,
    String? roomName,
  }) {
    _id = id;
    _roomId = roomId;
    _userId = userId;
    _createTime = createTime;
    _updateTime = updateTime;
    _isDeleted = isDeleted;
    _userType = userType;
    _roomName = roomName;
  }

  GroupBean.fromJson(dynamic json) {
    _id = json['id'];
    _roomId = json['roomId'];
    _userId = json['userId'];
    _createTime = json['createTime'];
    _updateTime = json['updateTime'];
    _isDeleted = json['isDeleted'];
    _userType = json['userType'];
    _roomName = json['roomName'];
  }

  String? _id;
  String? _roomId;
  String? _userId;
  String? _createTime;
  String? _updateTime;
  bool? _isDeleted;
  String? _userType;
  String? _roomName;

  GroupBean copyWith({
    String? id,
    String? roomId,
    String? userId,
    String? createTime,
    String? updateTime,
    bool? isDeleted,
    String? userType,
    String? roomName,
  }) =>
      GroupBean(
        id: id ?? _id,
        roomId: roomId ?? _roomId,
        userId: userId ?? _userId,
        createTime: createTime ?? _createTime,
        updateTime: updateTime ?? _updateTime,
        isDeleted: isDeleted ?? _isDeleted,
        userType: userType ?? _userType,
        roomName: roomName ?? _roomName,
      );

  String? get id => _id;

  String? get roomId => _roomId;

  String? get userId => _userId;

  String? get createTime => _createTime;

  String? get updateTime => _updateTime;

  bool? get isDeleted => _isDeleted;

  String? get userType => _userType;

  String? get roomName => _roomName;

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    map['id'] = _id;
    map['roomId'] = _roomId;
    map['userId'] = _userId;
    map['createTime'] = _createTime;
    map['updateTime'] = _updateTime;
    map['isDeleted'] = _isDeleted;
    map['userType'] = _userType;
    map['roomName'] = _roomName;
    return map;
  }
}
